<template>
  <n-config-provider :locale="zhCN" :date-locale="dateZhCN">
    <n-date-picker v-model:value="dataVal" panel type="daterange" @update:value="handleDateUpdate"
      @confirm="handleDateConfirm" />
  </n-config-provider>

</template>
<script setup lang="ts">
import { ref } from "vue"
import { NConfigProvider } from 'naive-ui'
import { zhCN, dateZhCN } from 'naive-ui'
const dataVal = ref("")
// 时间选择
// [开始时间时间戳，结束时间时间戳]
const handleDateUpdate = (val: string[]) => {
  console.log("选择时间", val)
}
//确认
const handleDateConfirm = (val: string[]) => {
  console.log("确认时间", val)
  console.log("绑定时间", dataVal.value)
}
</script>